<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
	<th:block th:include="include :: header('操作日志详细')" />
	<th:block th:include="include :: jsonview-css" />
</head>
<body class="white-bg">
	<div class="wrapper wrapper-content animated fadeInRight ibox-content">
	<form class="form-horizontal m-t" id="signupForm">
		<div class="form-group">
			<label class="col-sm-2 control-label">操作模块：</label>
			<div class="form-control-static" th:text="${sysLog.logContent} + ' / ' + ${@dict.getLabel('15',sysLog.operateType)}">
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label">登录信息：</label>
			<div class="form-control-static" th:text="${sysLog.username} +  ' / ' + ${sysLog.ip}+ ' / ' + ${sysLog.loginLocation}">
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label">请求地址：</label>
			<div class="form-control-static" th:text="${sysLog.requestUrl}">
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label">请求方式：</label>
			<div class="form-control-static" th:text="${sysLog.requestType}">
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label">操作方法：</label>
			<div class="form-control-static" th:text="${sysLog.method}">
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label">请求参数：</label>
			<div class="form-control-static"><pre id="operParam"></pre></div>
		</div>
	</form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: jsonview-js" />
    <script th:inline="javascript">
	    const formatSting = function (data) {
	    	if(data){
				let params = data.split("  ");
				let paramText = "<div class=\"jsonview\">" +
						"<ul class=\"obj level0\">";
				params.forEach(value => {
					if($.common.isNotEmpty(value)){
						paramText += "<li>" + value + "</li>";
					}
				});
				paramText += "</ul>" +
						"</div>"
				return paramText;
			}else {
	    		return "";
			}
		};
		$(function() {
	    	var operParam = [[${sysLog.requestParam}]];
	    	if ($.common.isNotEmpty(operParam) && operParam.length < 2000 && operParam.indexOf("{") !== -1) {
	    		$("#operParam").JSONView(operParam);
	    	} else {
				let paramText = formatSting(operParam);
				$("#operParam").html(paramText);
				paramText = "";
	    	}
	    });
	</script>
</body>
</html>